using System;
using HCP.Responses;
using HCP.SimpleJSON;
using UnityEngine;

namespace HCP.Requests
{
	public class ClosePopup : JobRequest
	{
		public ClosePopup(JSONClass json) : base(json)
		{
		}

		public override JobResponse Process()
		{
			string value = string.Empty;
			GameObject gameObject = Scene.CurrentPopup();
			if (gameObject != null)
			{
				Scene.ClosePopup(gameObject.name, null);
				gameObject = Scene.CurrentPopup();
				if (gameObject != null)
				{
					value = gameObject.name;
				}
			}
			return new StringResponse(value);
		}
	}
}
